package com.gitee.aurora.engine.vo;

import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * author: jiangfuxiao
 * Date:2022/9/24 17:48
 */
public class ResultCheckVo {

    private Integer baqCount ;
    private Integer sjzxCount ;
    private Integer stSjzxCount;
    private Integer zfjdCount;
    private ResultZfjdData  resultZfjdData;
    private List<ResultSjzxData>   resultSjzxData;
    private List<ResultBaqData>    resultBaqData;
    private String tableName;
    private String stSjzxIp;


    public void setResultBaqDatas(StDataResultVo stResultVo){
        this.resultBaqData = new ArrayList<>();
        stResultVo.getSjzxData().forEach(v -> {
            ResultBaqData resultBaqTab = new ResultBaqData();
            resultBaqTab.setSjzxIp(v.getSjzxIp());
            v.getGroupBaqData().forEach((baqIp,baqData) ->{
                if (!CollectionUtils.isEmpty(baqData)){
                    resultBaqTab.setStatus(1);
                }
            });
            resultBaqTab.setGroupBaqData(v.getGroupBaqData());
            resultBaqData.add(resultBaqTab);
        });
    }

    public void setResultSjzxDatas(String stSjzxIp,StDataResultVo stResultVo){
        this.resultSjzxData = new ArrayList<>();
        stResultVo.getSjzxData().forEach(dataResultVo -> {
            ResultSjzxData resultSjzxTab = new ResultSjzxData();
            resultSjzxTab.setStSjzxIp(stSjzxIp);
            resultSjzxTab.setGroupSjzxDatas(stResultVo);
            resultSjzxTab.getGroupSjzxData().forEach(((sjzxIp,sjzxData) -> {
                if (!CollectionUtils.isEmpty(sjzxData)) {
                    resultSjzxTab.setStatus(1);
                }
            }));
            this.resultSjzxData.add(resultSjzxTab);
        });
    }

    public void setResultZfjdDatas(String zfjdIp,StDataResultVo stResultVo){
        this.resultZfjdData = new ResultZfjdData();
        this.resultZfjdData.setZfjdIp(zfjdIp);
        this.resultZfjdData.setStatus(1);

        this.resultZfjdData.setStSjzxIdss(stResultVo);
    }

    public Integer getBaqCount() {
        return baqCount;
    }

    public void setBaqCount(Integer baqCount) {
        this.baqCount = baqCount;
    }

    public Integer getSjzxCount() {
        return sjzxCount;
    }

    public void setSjzxCount(Integer sjzxCount) {
        this.sjzxCount = sjzxCount;
    }

    public Integer getStSjzxCount() {
        return stSjzxCount;
    }

    public void setStSjzxCount(Integer stSjzxCount) {
        this.stSjzxCount = stSjzxCount;
    }

    public Integer getZfjdCount() {
        return zfjdCount;
    }

    public void setZfjdCount(Integer zfjdCount) {
        this.zfjdCount = zfjdCount;
    }

    public ResultZfjdData getResultZfjdData() {
        return resultZfjdData;
    }

    public void setResultZfjdData(ResultZfjdData resultZfjdData) {
        this.resultZfjdData = resultZfjdData;
    }

    public List<ResultSjzxData> getResultSjzxData() {
        return resultSjzxData;
    }

    public void setResultSjzxData(List<ResultSjzxData> resultSjzxData) {
        this.resultSjzxData = resultSjzxData;
    }

    public List<ResultBaqData> getResultBaqData() {
        return resultBaqData;
    }

    public void setResultBaqData(List<ResultBaqData> resultBaqData) {
        this.resultBaqData = resultBaqData;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getStSjzxIp() {
        return stSjzxIp;
    }

    public void setStSjzxIp(String stSjzxIp) {
        this.stSjzxIp = stSjzxIp;
    }
}
